﻿using Demo_test.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Demo_test.Controllers
{
    public class LonginController : Controller
    {
        // GET: Longin
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult Webcoml()
        {
            return View();
        }
        [HttpPost]
        public ActionResult Login (AccountViewmodel avm)
        {
            if(avm.account.Username.Equals("abc") && avm.account.Password.Equals("123"))
            {
                Session["username"] = avm.account.Username;
                return View("Webcoml");
            }
            else
            {
                ViewBag.Error = "Loi roi";
                return View("Index");
            }
            
        }
    }
}